#if !defined(__MEMCACHEASIO_REQUEST_H__)
#define __MEMCACHEASIO_REQUEST_H__

/* Copyright (c) 2008, dZettaApart.
   Licensed under the BSD License.
   See COPYING for details. */

#if defined(_MSC_VER) && (_MSC_VER >= 1020)
# pragma once
#endif

#include <boost/bind.hpp>
#include <boost/shared_ptr.hpp>
#include <boost/function.hpp>

#include <cstdlib>

namespace memcacheasio
{

	class Connection;

	class Request : private boost::noncopyable
	{
		public:
			friend class Connection;
			typedef boost::shared_ptr< Request > Ptr;
		public:
			Request (	int /*command*/,
			          const std::string /*key*/,
			          const std::string /*value*/ );
			~Request();

			enum COMMAND
			{
				COMMAND_GET = 0,
				COMMAND_SET = 1,
				COMMAND_DELETE = 2,
				COMMAND_INCR = 3,
				COMMAND_DECR = 4,
				COMMAND_ADD = 5
			};

			int command() ;

			std::string key();

			std::string request();

			bool responseStatus();

			std::string response();

			std::map< std::string, std::string > multyResponse();

		private:
			int					_command;
			std::string				_key;
			std::string				_value;
			bool					_status;
			std::map< std::string, std::string >    _multy_value;
			boost::shared_ptr<boost::asio::deadline_timer>	_deadline_timer;

			void setResponse ( const std::string& );
	};
};//namespace memcacheasio

#endif // !defined(__MEMCACHEASIO_REQUEST_H__)
